﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace SysAdmin._02_Common
{
    public class Win32Tool
    {
        [DllImport("User32.dll")]

        public static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);

        [DllImport("User32.dll")]

        public static extern bool SetForegroundWindow(IntPtr hWnd);

        [DllImport("USER32.DLL")]
        public static extern int GetSystemMenu(int hwnd, int bRevert);

        [DllImport("USER32.DLL")]
        public static extern int RemoveMenu(int hMenu, int nPosition, int wFlags);


        public const int MF_REMOVE = 0x1000;
        public const int SC_RESTORE = 0xF120;  // 还原
        public const int SC_MOVE = 0xF010;     // 移动
        public const int SC_SIZE = 0xF000;     // 大小
        public const int SC_MINIMIZE = 0xF020; // 最小化
        public const int SC_MAXIMIZE = 0xF030; // 最大化
        public const int SC_CLOSE = 0xF060;    // 关闭
    }
}
